<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="../css/common.css" />
<script src="../js/common/jquery.js"></script>
<script src="../js/common/drag.js"></script>
<script src="../js/common/angular.min.js"></script>
<script type="text/javascript" src="../js/common/common.js"></script>
<script type="text/javascript" src="../js/reverse.js"></script>
</head>
<body ng-app="myApp">

<div class="dqwz">
    <span>当前位置：</span>
    <span>AngularJS 过滤器</span>
</div>

<section>
    <div ng-controller="uppercaseCtrl">
        <h3>【转化为大写】</h3>
        <span>{{names | uppercase}}</span>
        <!-- 查看源码开始 -->
        <div class="htmlCode">
            <span>【html源码】</span>
            <xmp ng-non-bindable>
<span>{{names | uppercase}}</span>
            </xmp>
            <span>【js源码】</span>
            <xmp>
app.controller('uppercaseCtrl',function($scope){
    $scope.names = 'zhangmenglei';
 })
            </xmp>
            <span class="close"><a href="javascript:;">关闭</a></span>
        </div>
        <div class="viewCode">
            <span><a href="javascript:;"> >>查看源码</a></span>
        </div>
        <!-- 查看源码结束 -->
    </div>

    <div ng-controller="lowercaseCtrl">
        <h3>【转化为小写】</h3>
        <span>{{namess | lowercase}}</span>
        <!-- 查看源码开始 -->
        <div class="htmlCode">
            <span>【html源码】</span>
            <xmp ng-non-bindable>
<span>{{namess | lowercase}}</span>
            </xmp>
            <span>【js源码】</span>
            <xmp>
app.controller('lowercaseCtrl',function($scope){
    $scope.namess = 'ZHANGMENGLEI';
 })
            </xmp>
            <span class="close"><a href="javascript:;">关闭</a></span>
        </div>
        <div class="viewCode">
            <span><a href="javascript:;"> >>查看源码</a></span>
        </div>
        <!-- 查看源码结束 -->
    </div>

    <div ng-controller="currencyCtrl">
        <h3>【转化为货币格式】</h3>
        <input type="number" name="" ng-model="number"/>
        <input type="text" name="" ng-model="price"/>
        <p>{{(number * price) | currency}}</p>
        <!-- 查看源码开始 -->
        <div class="htmlCode">
            <span>【html源码】</span>
            <xmp ng-non-bindable>
<input type="number" name="" ng-model="number"/>
<input type="text" name="" ng-model="price"/>
<p>{{(number * price) | currency}}</p>
            </xmp>
            <span>【js源码】</span>
            <xmp>
app.controller('currencyCtrl',function($scope){
    $scope.number = 1;
    $scope.price = 22.36;
 })
            </xmp>
            <span class="close"><a href="javascript:;">关闭</a></span>
        </div>
        <div class="viewCode">
            <span><a href="javascript:;"> >>查看源码</a></span>
        </div>
        <!-- 查看源码结束 -->
    </div>

    <div ng-controller="orderByCtrl">
        <h3>【排列数组】</h3>
        <ul>
            <li ng-repeat="x in orderBy | orderBy:'country'">
                <span>{{x.name + ',' + x.country}}</span>
            </li>
        </ul>
        <!-- 查看源码开始 -->
        <div class="htmlCode">
            <span>【html源码】</span>
            <xmp ng-non-bindable>
<ul>
    <li ng-repeat="x in orderBy | orderBy:'country'">
        <span>{{x.name + ',' + x.country}}</span>
    </li>
</ul>
            </xmp>
            <span>【js源码】</span>
            <xmp>
app.controller('orderByCtrl',function($scope){
    $scope.orderBy = [
        {name:'小李',country:'aaa'},
        {name:'小名',country:'bbb'},
        {name:'小丽',country:'ccc'},
        {name:'小华',country:'ddd'}
    ]
 })
            </xmp>
            <span class="close"><a href="javascript:;">关闭</a></span>
        </div>
        <div class="viewCode">
            <span><a href="javascript:;"> >>查看源码</a></span>
        </div>
        <!-- 查看源码结束 -->
    </div>

    <div ng-controller="filterCtrl">
        <h3>【过滤输入】</h3>
        <input type="text" name="" ng-model="filter"/>
        <ul>
            <li ng-repeat="x in filterObj | filter:filter">
                {{x.name}}
            </li>
        </ul>
        <!-- 查看源码开始 -->
        <div class="htmlCode">
            <span>【html源码】</span>
            <xmp ng-non-bindable>
<input type="text" name="" ng-model="filter"/>
<ul>
    <li ng-repeat="x in filterObj | filter:filter">
        {{x.name}}
    </li>
</ul>
            </xmp>
            <span>【js源码】</span>
            <xmp>
app.controller('filterCtrl',function($scope){
    $scope.filterObj = [
        {name:'andaknda'},
        {name:'bdadwada'},
        {name:'cdadadwad'},
        {name:'dpdaidab'},
        {name:'eoacjxamx'},
        {name:'fdaxaafmnx'},
    ]
 })
            </xmp>
            <span class="close"><a href="javascript:;">关闭</a></span>
        </div>
        <div class="viewCode">
            <span><a href="javascript:;"> >>查看源码</a></span>
        </div>
        <!-- 查看源码结束 -->
    </div>

    <div ng-controller="filterCtrl">
        <h3>【自定义过滤器】</h3>
        <ul>
            第一个参数：{{filterObj[2]|custom:filterObj}}
            第二个参数：{{filterObj[2]|custom2:filterObj}}
        </ul>
        <!-- 查看源码开始 -->
        <div class="htmlCode">
            <span>【html源码】</span>
            <xmp ng-non-bindable>
<ul>
    第一个参数：{{filterObj[2]|custom:filterObj}}
    第二个参数：{{filterObj[2]|custom2:filterObj}}
</ul>
            </xmp>
            <span>【js源码】</span>
            <xmp>
app.filter('custom',function(){
    return function(name,arr){
        return name;
    }
})
app.filter('custom2',function(){
    return function(name,arr){
        return arr;
    }
})
            </xmp>
            <span class="close"><a href="javascript:;">关闭</a></span>
        </div>
        <div class="viewCode">
            <span><a href="javascript:;"> >>查看源码</a></span>
        </div>
        <!-- 查看源码结束 -->
    </div>
</section>

<div class="mask_layer">
</div>

</body>
</html>